<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script src="https://cdn.staticfile.org/vue/2.6.14/vue.js"></script>
    <script src="https://cdn.staticfile.org/vuex/3.6.2/vuex.js"></script>
    <script src="./moduleA.js"></script>
    <script src="./moduleB.js"></script>
  </head>
  <body>
    <div id="app"></div>
    <script>
      const { mapState, mapGetters } = Vuex;

      var store = new Vuex.Store({
        modules: {
          a: moduleA,
          b: moduleB,
        },
      });

      store.state.a.count;
      store.state.b.count;
      // 默认state的状态是局部的

      // 默认 getters mutations actions  的状态是全局的
      store.getters["a/countX"]; // 模块A 声明了局部命名空间 namespaced: true,
      store.getters["countX"];
    </script>
  </body>
</html>
